package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipParamItemService;
import cc.comac.mom.bean.EquipParamItem;
import cc.comac.mom.util.ResultBean;

@RestController
@RequestMapping("/EquipParamItem")
public class EquipParamItemController {
	@Autowired
	private EquipParamItemService equipParamItemService;

	@RequestMapping(value = "/insert",method = RequestMethod.POST)
	public Object insert(@RequestBody EquipParamItem equipParamItem) {
		ResultBean insert = equipParamItemService.insert(equipParamItem);
		return insert;
	}

	@RequestMapping(value = "/update",method = RequestMethod.POST)
	public Object update(@RequestBody EquipParamItem equipParamItem) {
		 ResultBean update = equipParamItemService.update(equipParamItem);
		return update;
	}

	@RequestMapping(value = "/batchDelete",method = RequestMethod.POST)
	public Object batchDelete(@RequestBody List<EquipParamItem> equipParamItemList) {
		 ResultBean batchDelete = equipParamItemService.batchDelete(equipParamItemList);
		return batchDelete;
	}

	// 分页查询所有
	@RequestMapping(value = "/selectAllByPage",method = RequestMethod.POST)
	public ResultBean selectAllByPage(@RequestBody EquipParamItem equipParamItem) {
			ResultBean selectAllByPage = equipParamItemService.selectAllByPage(equipParamItem);
		return selectAllByPage;
	}

	// 根据参数组name值返回参数项集合
	@RequestMapping(value = "/returnParamItems",method = RequestMethod.POST)
	public ResultBean returnParamItems(@RequestBody EquipParamItem equipParamItem) {
			ResultBean returnSelectAllByParamName = equipParamItemService.returnSelectAllByParamName(equipParamItem);
		return returnSelectAllByParamName;
	}

	// 根据参数组name和参数项name值返回参数
	@RequestMapping(value = "/returnParamItem",method = RequestMethod.POST)
	public ResultBean returnParamItem(@RequestBody EquipParamItem equipParamItem) {
		ResultBean returnSelectAllByParamNameandParamItemName = equipParamItemService.returnSelectAllByParamNameandParamItemName(equipParamItem);
		return returnSelectAllByParamNameandParamItemName;
	}
}
